﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using RuleCode.Table;

namespace map.member
{
    public partial class configshop_nomal : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bind1();
                //bind2();
            }
        }
        private void bind1()
        {
            cbuser u = cbuser.Find(" cbuserid = '" + AliApi.appUserId + "'");
            HyperLink_openshop.NavigateUrl = ResolveUrl("~/member/default.aspx")
                + "?cbshoppageid=0&id=" + u.RECID.ToString();

            cbshop s = cbshop.Find(" cbuserid = '" + AliApi.appUserId + "' ");
            RadioButtonList3.SelectedValue = s.cbshoppagecss.ToString();

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            string sql = " exec [复制店铺样式] ";
            if (RadioButtonList3.SelectedValue == "红色主题")
            {
                sql += " 'red@rulecode.com' ";
            }
            if (RadioButtonList3.SelectedValue == "蓝色主题")
            {
                sql += " 'blue@rulecode.com' ";
            }
            if (RadioButtonList3.SelectedValue == "绿色主题")
            {
                sql += " 'green@rulecode.com' ";
            }
            if (RadioButtonList3.SelectedValue == "金色主题")
            {
                sql += " 'gold@rulecode.com' ";
            }
            if (RadioButtonList3.SelectedValue == "灰色主题")
            {
                sql += " 'gray@rulecode.com' ";
            }

            sql += ", '" + AliApi.appUserId + "' ";
            RuleCode.Common.SqlHelper.Instance.ExecuteNonQuery(CommandType.Text, sql);
            MessageBox.Show(this.UpdatePanel1, "操作完成。");
        }

        protected void Button14_Click(object sender, EventArgs e)
        {
            string sql = " exec [复制店铺内容] ";
            if (RadioButtonList4.SelectedValue == "店铺模板1")
            {
                sql += " 'shop2@rulecode.com' ";
            }


            sql += ", '" + AliApi.appUserId + "' ";
            RuleCode.Common.SqlHelper.Instance.ExecuteNonQuery(CommandType.Text, sql);
            MessageBox.Show(this.Page, "操作完成。");
        }

        protected void RadioButtonList4_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void RadioButtonList3_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
